{extend name="base" /}
{block name="body"}
<div class="layui-card">
    <div class="layui-card-body">
        <form action="{:request()->url()}" class="layui-form" method="post">

            <div class="layui-col-md4">
                <div class="layui-form-item">
                    <label class="layui-form-label">输入框</label>
                    <div class="layui-input-block">
                        <select name="input">
                            {foreach name="input" key="k" item="r"}
                            <option value="{$k}" {if condition="isset($data) and $data.input eq $k"}selected="selected"{/if}>{$r}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-col-md4">
                <div class="layui-form-item">
                    <label class="layui-form-label">排序</label>
                    <div class="layui-input-block">
                        <input type="text" name="sort_order" value="{$data.sort_order|default='100'}" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
            </div>
            {if isset($data)}
            <div class="layui-col-md4">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否修改表</label>
                    <div class="layui-input-block">
                        <input type="radio" name="is_edit" value="1" title="是">
                        <input type="radio" name="is_edit" value="0" title="否" checked>
                    </div>
                </div>
            </div>
            {/if}
            <hr>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">字段名称</label>
                    <div class="layui-input-block">
                        <input type="text" value="{$data.field|default=''}" autocomplete="off" placeholder="" class="layui-input layui-bg-gray" readonly>
                    </div>
                </div>
            </div>

            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">注释</label>
                    <div class="layui-input-block">
                        <input type="text" name="comment" value="{$data.comment|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">字段类型</label>
                    <div class="layui-input-block">
                        <select name="type" lay-search>
                            {foreach name="type" item="r"}
                            <option value="{$r}" {if condition="isset($data) and $data.type eq $r"}selected="selected"{/if}>{$r}</option>
                            {/foreach}
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">字符集</label>
                    <div class="layui-input-block">
                        <input type="text" name="collation" value="{$data.collation|default='utf8_general_ci'}" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">字段长度</label>
                    <div class="layui-input-block">
                        <input type="text" name="length" value="{$data.length|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">小数点</label>
                    <div class="layui-input-block">
                        <input type="text" name="point" value="{$data.point|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否为空</label>
                    <div class="layui-input-block">
                        <select name="null">
                            <option value="NO" {if condition="isset($data) and $data.null eq 'NO'"}selected="selected"{/if}>不为空</option>
                            <option value="YES" {if condition="isset($data) and $data.null eq 'YES'"}selected="selected"{/if}>可为空</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">是否主键</label>
                    <div class="layui-input-block">
                        <select name="key">
                            <option value="" {if condition="isset($data) and $data.key eq ''"}selected="selected"{/if}>非主键</option>
                            <option value="PRI" {if condition="isset($data) and $data.key eq 'PRI'"}selected="selected"{/if}>主键</option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">默认值</label>
                    <div class="layui-input-block">
                        <input type="text" name="default" value="{$data.default|default=''}" autocomplete="off" placeholder="" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md6">
                <div class="layui-form-item">
                    <label class="layui-form-label">自动递增</label>
                    <div class="layui-input-block">
                        <select name="extra">
                            <option value="auto_increment" {if condition="isset($data) and $data.extra eq 'auto_increment'"}selected="selected"{/if}>自动递增</option>
                            <option value="" {if condition="isset($data) and $data.extra eq ''"}selected="selected"{/if}>不递增</option>
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    {:token_field()}
                    <button class="layui-btn" lay-filter="i" lay-submit="">保存</button>
                    <button class="layui-btn layui-btn-primary" type="reset">重置</button>
                </div>
            </div>
        </form>
    </div>
</div>
{/block}
{block name="js"}
<script>

</script>
{/block}